//
//  HomepageListTopItem.m
//  JiuJiuShangCheng
//
//  Created by jiujiukeji on 2018/7/4.
//  Copyright © 2018年 jiujiukeji. All rights reserved.
//

#import "HomepageListTopItem.h"

@implementation HomepageListTopItem

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        WeakSelf
        
        self.backgroundColor = UIColorWhite;
        
        self.iconImg = [UIImageView new];
        [_iconImg sizeToFit];
        [self addSubview:_iconImg];
        [_iconImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(rateWidth(30));
            make.centerY.equalTo(self);
//            make.size.mas_offset(CGSizeMake(rateWidth(40), rateWidth(40)));
        }];
        
        self.nameLB = [UILabel labelWithText:@"" textColor:UIColorFromRGB(0x333333) fontSize:15];
        [_nameLB sizeToFit];
        [self addSubview:_nameLB];
        [_nameLB mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(weakSelf.iconImg.mas_right).offset(rateWidth(15));
            make.centerY.equalTo(self);
        }];
        
        self.moreBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
        [self.moreBtn setImage:UIImageNamed(@"homepage_more") forState:(UIControlStateNormal)];
//        [self.moreBtn sizeToFit];
        [self addSubview:_moreBtn];
        [_moreBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.right.equalTo(self);
            make.size.mas_offset(CGSizeMake(rateWidth(80), rateHeight(80)));
        }];
        
    }
    return self;
}

@end
